package com.yilian.xlmusic.android.utils.net;

import com.yilian.xlmusic.android.XlMusicActivity;
import com.yilian.xlmusic.android.utils.SelectCallBack;
import com.yilian.xlmusic.android.view.bean.ChangeItem;

import java.util.ArrayList;
import java.util.List;

public class AppConstants {

    /**
     * 接口域名
     */
    public static final String EDUCATION = "https://www.niaitrip.com";

    public static String METHOD_NAME;

    //public static String ACCESS_TOKEN = "jWSFiUVo5mxxJFVdqkHCrg==";

    public static String ACCESS_TOKEN = "0vX78////0pNLA6W+zHjO4yZEDvrvtymVabF3kFTA1STgKoB2UGI8OrzY4nACiua";
    public static String ACCESS_TOKEN_KEY = "Access-Token";
    //适配器刷新
    public static List<ChangeItem> changeItems = new ArrayList<>();

    //刷新View
    public static void refreshView(ChangeItem refresh_item) {
        if(XlMusicActivity.mMediaPlayerUtils.isPlaying()){
            XlMusicActivity.mMediaPlayerUtils.stop();
        }
        if(AppConstants.changeItems.size()>0){
            refresh_item.getDataBean().setIs_play(false);
            refresh_item.setDataBean(refresh_item.getDataBean());
            refresh_item.getItemRecycleViewAdapter().getData().set(refresh_item.getChangePosition(), refresh_item.getDataBean());
            refresh_item.getItemRecycleViewAdapter().notifyItemChanged(refresh_item.getChangePosition(), refresh_item.getDataBean());
            AppConstants.changeItems.clear();
        }

    }
    public static SelectCallBack selectCallBack;

    public static void setSelectListen(String token, SelectCallBack callBack) {
        selectCallBack = callBack;
        AppConstants.ACCESS_TOKEN = token;
    }


}
